package com.ruoyi.system.mapper;

import java.util.List;
import com.ruoyi.system.domain.HospitalSubscribeOrder;
import com.ruoyi.system.domain.vo.HospitalSubscribeOrderVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 订单Mapper接口
 * 
 * @author ruoyi
 * @date 2025-04-30
 */
public interface HospitalSubscribeOrderMapper 
{
    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    public HospitalSubscribeOrder selectHospitalSubscribeOrderById(Long id);

    /**
     * 查询订单列表
     * 
     * @param hospitalSubscribeOrder 订单
     * @return 订单集合
     */
    public List<HospitalSubscribeOrder> selectHospitalSubscribeOrderList(HospitalSubscribeOrder hospitalSubscribeOrder);

    /**
     * 新增订单
     * 
     * @param hospitalSubscribeOrder 订单
     * @return 结果
     */
    public int insertHospitalSubscribeOrder(HospitalSubscribeOrder hospitalSubscribeOrder);

    /**
     * 修改订单
     * 
     * @param hospitalSubscribeOrder 订单
     * @return 结果
     */
    public int updateHospitalSubscribeOrder(HospitalSubscribeOrder hospitalSubscribeOrder);

    /**
     * 删除订单
     * 
     * @param id 订单主键
     * @return 结果
     */
    public int deleteHospitalSubscribeOrderById(Long id);

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteHospitalSubscribeOrderByIds(Long[] ids);

    /**
     * 查询订单关联的所有信息
     * @param hospitalSubscribeOrder
     * @return
     */
    List<HospitalSubscribeOrderVo> getOrderAllInfo(@Param("info") HospitalSubscribeOrder hospitalSubscribeOrder);

    /**
     * 获取超时订单
     */
    List<HospitalSubscribeOrder> closeOrderList();

    /**
     * 根据订单号查询订单信息
     * @param orderNo
     * @return
     */
    HospitalSubscribeOrder getOrderInfoByOrderNo(@Param("orderNo") String orderNo);

    /**
     * 已预约待上传结果
     */
    void completeOrderList();

    @Update("update hospital_subscribe_order set status = 7 where curdate() > #{date} and id = #{id}")
    void closeOrderById(@Param("id") Long id,@Param("date") String date);
}
